package com.tanhua.controller;

import com.tanhua.service.BaiduService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/baidu")
public class BaiduController {
    @Autowired
    private BaiduService baiduService;
    /**
     * POST/baidu/location
     * 上报地理位置
     */
    public ResponseEntity location(@RequestBody Map map){
        Double latitude = (Double) map.get("latitude");
        Double longitude = (Double) map.get("longitude");
        String addrStr = (String) map.get("addrStr");
        return baiduService.location(latitude,longitude,addrStr);
    }

}
